home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / access.man < prev    next >
Encoding:
Text File  |  1989-03-15  |  4.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ACCESS                C Library Procedures                 ACCESS
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      access - determine accessibility of file
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ##iinncclluuddee <<ssyyss//ffiillee..hh>>
  13.  
  14.      ##ddeeffiinnee RR__OOKK    44//** tteesstt ffoorr rreeaadd ppeerrmmiissssiioonn **//
  15.      ##ddeeffiinnee WW__OOKK    22//** tteesstt ffoorr wwrriittee ppeerrmmiissssiioonn **//
  16.      ##ddeeffiinnee XX__OOKK    11//** tteesstt ffoorr eexxeeccuuttee ((sseeaarrcchh)) ppeerrmmiissssiioonn **//
  17.      ##ddeeffiinnee FF__OOKK    00//** tteesstt ffoorr pprreesseennccee ooff ffiillee **//
  18.  
  19.      aacccceessssiibbllee == aacccceessss((ppaatthh,, mmooddee))
  20.      iinntt aacccceessssiibbllee;;
  21.      cchhaarr **ppaatthh;;
  22.      iinntt mmooddee;;
  23.  
  24. DDEESSCCRRIIPPTTIIOONN
  25.      _A_c_c_e_s_s checks the given file _p_a_t_h for accessibility accord-
  26.      ing to _m_o_d_e, which is an inclusive or of the bits R_OK, W_OK
  27.      and X_OK.  Specifying _m_o_d_e as F_OK (i.e., 0) tests whether
  28.      the directories leading to the file can be searched and the
  29.      file exists.
  30.  
  31.      The real user ID and the group access list (including the
  32.      real group ID) are used in verifying permission, so this
  33.      call is useful to set-UID programs.
  34.  
  35.      Notice that only access bits are checked.  A directory may
  36.      be indicated as writable by _a_c_c_e_s_s, but an attempt to open
  37.      it for writing will fail (although files may be created
  38.      there); a file may look executable, but _e_x_e_c_v_e will fail
  39.      unless it is in proper format.
  40.  
  41. RREETTUURRNN VVAALLUUEE
  42.      If _p_a_t_h cannot be found or if any of the desired access
  43.      modes would not be granted, then a -1 value is returned;
  44.      otherwise a 0 value is returned.
  45.  
  46. EERRRROORRSS
  47.      Access to the file is denied if one or more of the following
  48.      are true:
  49.  
  50.      [ENOTDIR]      A component of the path prefix is not a
  51.                     directory.
  52.  
  53.      [EINVAL]       The pathname contains a character with the
  54.                     high-order bit set.
  55.  
  56.      [ENAMETOOLONG] A component of a pathname exceeded 255 char-
  57.                     acters, or an entire path name exceeded 1023
  58.                     characters.
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0               May 22, 1986                          1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ACCESS                C Library Procedures                 ACCESS
  71.  
  72.  
  73.  
  74.      [ENOENT]       The named file does not exist.
  75.  
  76.      [EACCES]       Search permission is denied for a component
  77.                     of the path prefix.
  78.  
  79.      [ELOOP]        Too many symbolic links were encountered in
  80.                     translating the pathname.
  81.  
  82.      [EROFS]        Write access is requested for a file on a
  83.                     read-only file system.
  84.  
  85.      [ETXTBSY]      Write access is requested for a pure pro-
  86.                     cedure (shared text) file that is being exe-
  87.                     cuted.
  88.  
  89.      [EACCES]       Permission bits of the file mode do not per-
  90.                     mit the requested access, or search permis-
  91.                     sion is denied on a component of the path
  92.                     prefix.  The owner of a file has permission
  93.                     checked with respect to the ``owner'' read,
  94.                     write, and execute mode bits, members of the
  95.                     file's group other than the owner have per-
  96.                     mission checked with respect to the ``group''
  97.                     mode bits, and all others have permissions
  98.                     checked with respect to the ``other'' mode
  99.                     bits.
  100.  
  101.      [EFAULT]       _P_a_t_h points outside the process's allocated
  102.                     address space.
  103.  
  104.      [EIO]          An I/O error occurred while reading from or
  105.                     writing to the file system.
  106.  
  107. SSEEEE AALLSSOO
  108.      chmod(2), stat(2)
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0               May 22, 1986                          2
  130.  
  131.  
  132.  
  133.